package com.nlp.visualization.core.sentence;


import com.nlp.visualization.service.weibo.main.Main;
import org.apache.commons.collections.map.HashedMap;

import java.util.Map;

public class SentenceUtils {

    static Map<String, String> relationMap = new HashedMap();

    static {
        relationMap.put("SBV", "主谓关系");
        relationMap.put("VOB", "动宾关系");
        relationMap.put("IOB", "间宾关系");
        relationMap.put("FOB", "前置宾语");
        relationMap.put("DBL", "兼语");
        relationMap.put("ATT", "定中关系");
        relationMap.put("ADV", "状中结构");
        relationMap.put("CMP", "动补结构");
        relationMap.put("COO", "并列关系");
        relationMap.put("POB", "介宾关系");
        relationMap.put("LAD", "左附加");
        relationMap.put("RAD", "右附加");
        relationMap.put("IS", "独立结构");
        relationMap.put("WP", "标点符号");
        relationMap.put("HED", "核心关系");
        relationMap.put("主谓关系", "SBV");
        relationMap.put("动宾关系", "VOB");
        relationMap.put("间宾关系", "IOB");
        relationMap.put("前置宾语", "FOB");
        relationMap.put("兼语", "DBL");
        relationMap.put("定中关系", "ATT");
        relationMap.put("状中结构", "ADV");
        relationMap.put("动补结构", "CMP");
        relationMap.put("并列关系", "COO");
        relationMap.put("介宾关系", "POB");
        relationMap.put("左附加关系", "LAD");
        relationMap.put("右附加关系", "RAD");
        relationMap.put("独立结构", "IS");
        relationMap.put("标点符号", "WP");
        relationMap.put("核心关系", "HED");
    }

    public static SentenceType getSentenceType(String type) {

        for (SentenceType s : SentenceType.values()) {
            if (type.toUpperCase().equals(s.toString().toUpperCase())) {
                return s;
            }
        }
        return null;

    }

    public static String getRelationName(String name) {
        return relationMap.get(name);
    }

}
